package com.edt.ichannel.api.service.impl;

import cc.edt.iceutils2.random.IceRandomUtils;
import com.edt.ichannel.api.dao.IChannelLogDao;
import com.edt.ichannel.api.entiy.local.IChannelLog;
import com.edt.ichannel.api.service.IChannelLogService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;


/**
 * 操作流水日志 service
 *
 * @author 宋寒
 * 2018/5/31 9:58
 */
@Service
public class IChannelLogServiceImpl implements IChannelLogService {

    @Resource
    private IChannelLogDao iChannelLogDao;

    @Override
    public void saveIChannelLog(String logClass, String logFunction, String logText) {
        IChannelLog iChannelLog = new IChannelLog();
        iChannelLog.setLogId(IceRandomUtils.longUUID());
        iChannelLog.setLogClass(logClass);
        iChannelLog.setLogFunction(logFunction);
        iChannelLog.setLogText(logText);
        iChannelLog.setSysUser("API");
        iChannelLog.setSysDate(new Date());
        iChannelLog.setLogState("1");
        iChannelLogDao.saveIChannelLog(iChannelLog);
    }

}